<template>
  <div class="video-box">
    <div class="video-box-inner">
      <div class="title">
        视频播放
        <i @click="close"></i>
      </div>
      <div class="content">
        <video :src="data.filePath" controls="controls">
          您的浏览器不支持 video 标签。
        </video>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    name: "",
    props: {
      data: {
        type: Object,
      }
    },
    data() {
      return {}
    },
    created(){
      console.log(this.data);
    },
    methods: {
      close() {
        this.$emit('close')
      },
    },
  }
</script>

<style scoped type="text/scss" lang="scss">
  .video-box {
    position: fixed;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    top: 0;
    bottom: 0;
    z-index: 2000;

    .video-box-inner {
      position: absolute;
      width: 626px;
      height: 511px;
      background-color: #ffffff;
      left: 0;
      top: 0;
      right: 0;
      bottom: 0;
      margin: auto;
      border-radius: 6px;
      padding: 31px 31px 31px 31px;
      box-sizing: border-box;

      > .title {
        line-height: 1.1;
        font-size: 16px;
        color: #454a55;
        position: relative;
        height: 48px;
        font-weight: 600;

        > i {
          background-image: url("../../assets/img/close_icon.png");
          background-size: 16px 17px;
          background-position: center;
          background-repeat: no-repeat;
          position: absolute;
          width: 16px;
          height: 17px;
          top: 0px;
          right: 0px;
          cursor: pointer;
        }
      }

      > .content {
        height: calc(100% - 48px);
        background-color: #F2F6F9;
        video{
          display: block;
          width: 100%;
          height: 100%;
          outline: none;
        }
      }
    }
  }
</style>
